<div id="module" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
	<div class="block_header ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
		<?php if($liste == 'publications_recentes') :?> 
			<h1>Publications récentes </h1>
		<?php endif;?> 
                        
		<?php if($liste == 'mes_publications') :?> 
			<h1>Mes publications</h1>
		<?php endif;?> 
	</div>
	<div id="publication_liste" class="listing block_content ui-tabs-panel ui-widget-content ui-corner-bottom">
		<div class="description listing">
                  <?php if($liste == 'publications_recentes_tag') :?> 
                    <h4>Liste des publications concernant le tag <span class="tag_link"><?= $tags->libelle ?> : </span></h4>
                    <br/>
                  <?php endif;?>  
                  
		<?php if(isset($liste_publications) && count($liste_publications) > 0) : ?>
			<?php foreach($liste_publications as $publication): ?>
			<?php if(($liste == 'mes_publications' || $liste =='publications_recentes') &&  $this->session->userdata('id_utilisateur')!=null):?> 
							<?php if($publication->visible==1){?>
								<a href="<?= base_url() ?>publication/historique/<?= $publication->id_publication?>" class="historique">l'historique</a> 
							  <?php if(isset($publication->modifiable)&& $publication->modifiable==0){ ?>
								<a href="<?= base_url() ?>publication/adherer/<?= $publication->id_publication?>" class="adherer">Adhérer</a>  
							 <?php }?>
							<?php if(isset($publication->modifiable)&& $publication->modifiable==1){ ?>
								<a href="<?= base_url() ?>publication/modification_publication/<?= $publication->id_publication?>" class="edit" id="clic_modif_article">Modifier</a>
							<?php if($publication->supprimable==1){?>
								<a href="<?= base_url() ?>publication/supprimer/<?=$liste ?>/<?= $publication->id_publication?>" class="delete" id="clic_suppr_publication">Supprimer</a> 
							<?php }}}?>
									
			<?php endif;?>
                                                              
			<?php if(($liste == 'publications_recentes' && ($publication->prive == "0" || $publication->visible==1||$publication->prive == "1")) || $publication->id_utilisateur == $this->session->userdata('id_utilisateur')) :?> 
			<div class="publication">
                        			
				
                          
                <?php if(isset($publication->info) && count($publication->info) > 0) :                           
                    foreach($publication->info as $info) :  
                        ?>
						<br/> <br/>
					  <a href="<?= base_url() ?>publication/detail/<?= $publication->id_publication?>">
					   <h3 class="nom"><?= $info->titre ?>
                                   
									<?php // Affiche les tags 
									if(count($publication->tags) >= 0): ?>
										<span class="espace_titre_tag">	
											<?php foreach($publication->tags as $tag): ?>
											<span class="tag_link">	
											<a href="<?= base_url().'publication/tag_search/'.$tag->id_tag ?>"><?= $tag->libelle ?></a></span>
											<?php endforeach;?>
										</span><br />
									<?php endif; ?>		
									
						</h3>
						</a>
						<?= $info->contenu ?></p>
						<br/>
						<p class="date">Publié le <?= time_to_str($info->date_creation) ?> par <a href="<?= base_url() ?>utilisateur/profil/<?= $publication->id_utilisateur?>"><?= $publication->prenom.' '.$publication->nom ?></a>  
                        </p>
						<?php 
						//endif;
						endforeach;
						endif;
					    ?>
                  
                </div>
                                                        
			<?php endif;?>
                                          
                                    
                                                        
		<?php endforeach;
		else: ?>
			<p>Il n'y a aucune publication</p>
		<?php
		endif;
		?>
		</div>
	</div>
</div>
